package com.zzyl.mapper;

import com.zzyl.entity.Member;
import org.apache.ibatis.annotations.*;

/**
 * @Author:
 * @Description: TODO
 * @DateTime: 2024/6/16 11:57
 **/
@Mapper
public interface WeChatLoginMapper {

    //微信登录========================
    @Select("select * from member where open_id = #{openId}")
    Member findByOpenId(String openid);

    @Insert("insert into member (phone,name,open_id,create_time,update_time,create_by,update_by) values(" +
            "#{phone},#{name},#{openId},#{createTime},#{updateTime},#{createBy},#{updateBy})")
    @Options(useGeneratedKeys = true,keyProperty = "id") //获取新增数据的主键ID
    void insert(Member member);

    @Update("update member set phone = #{phone} where id =#{id}")
    void updatePhoneById(String phone, Long id);
}
